/*
 * @Author: 吴思浪
 * @Date: 2021-12-12 11:01:26
 * @LastEditors: 徐伟杰 1529315455@qq.com
 * @LastEditTime: 2022-07-15 14:07:04
 * @Description:
 * @Company: 3xData
 * @youWant: add you want
 */
import {
  reportSign_update,
  reportSign_form,
  reportUnitInfo,
} from "@/api/reportSign.js";

const reportSign = {
  namespaced: true,
  state: {
    fileUrl: "", // 业主签名文件路径
  },
  mutations: {
    save_area(state, data) {
      state.area = data;
    },
    setfile_url(state, data) {
      state.fileUrl = data;
    },
  },
  actions: {
    reportSign_update({ commit }, obj) {
      return new Promise((resolve, reject) => {
        reportSign_update(obj, function (data) {
          resolve(data);
        });
      });
    },
    reportSign_form({ commit }, obj) {
      return new Promise((resolve, reject) => {
        reportSign_form(obj, function (data) {
          resolve(data);
        });
      });
    },
    // 判断是否为社会单位用户
    reportUnitInfos({ commit }, obj) {
      return new Promise((resolve, reject) => {
        reportUnitInfo(obj, function (data) {
          resolve(data);
        });
      });
    },
    // 修改业主签名文件路径
    SETFILE_URL({ commit }, data) {
      commit("setfile_url", data);
    },
  },
};

export default reportSign;
